package MOLE.Bill;

import java.util.*;
import MOLE.*;

/** 
 Bills ��ժҪ˵����
*/
public class Bills extends Bill
{
	public Bills()
	{
		//
		// TODO: �ڴ˴���ӹ��캯���߼�
		//
	}


	public final DataTable GetBingoNumbers(int agentId, String term)
	{
	  String s = "select * from agentdg where agent_id=" + agentId + " and term_code='" + term + "'";
		DataTable d = MOLE.SQL.GetDataTable(s);
		return d;



	}

//C# TO JAVA CONVERTER WARNING: There is no Java equivalent to C#'s shadowing via the 'new' keyword:
//ORIGINAL LINE: public new ArrayList _Teuzhu()
public final ArrayList _Teuzhu()
{

		ArrayList all = new ArrayList();

		String[] sa = Number.split("[@]", -1);
		String groupId = MOLE.comm.getRandom();
		for (int i = 0;i < sa.length;i++)
		{
			ArrayList a = new ArrayList();
			a = TeuzhuSingle(sa[i].trim(), groupId);
			all = MOLE.comm.HabinArraylist(all, a);
		}

		return all;
}


//C# TO JAVA CONVERTER WARNING: There is no Java equivalent to C#'s shadowing via the 'new' keyword:
//ORIGINAL LINE: public new ArrayList TeuzhuSingle(string number,string groupId)
	public final ArrayList TeuzhuSingle(String number, String groupId)
	{

		Bill o = new Bill();
		o.BillOwner = this.BillOwner;
		o.DataId = this.DataId;
		o.Zhushor = this.Zhushor;
		o.Playid = this.Playid;
		o.UserNum = this.UserNum;
		o.UserName = this.UserName;
		o.Term = this.Term;
		o.Number = number;
		o.Groupid = groupId;
		o.Beishor = this.Beishor;
		o.UnitPrice = this.UnitPrice;
		o.BillValue = this.BillValue;
		return o._Teuzhu();

	}


	public final ArrayList GetBingoBillList(int agentId, String term)
	{
		ArrayList a = new ArrayList();
		String sql = "  select * from agentdg where agent_id=" + agentId + " and term_code='" + term + "'" + " and zj_jiangjin>0 ";
		DataTable d = MOLE.SQL.GetDataTable(sql);
		if (d.Rows.size() != 0)
		{
			for (int i = 0;i < d.Rows.size();i++)
			{
				int billid = Integer.parseInt(d.Rows[i]["adid"].toString().trim());
				a.add(new Bill(billid));
			}

		}
		 return a;
	}






}